/***************************************************************************
 *   Copyright (C) 2005 by ywchen2000                         *
 *   ywchen2000@yahoo.com.cn                                                          *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/
#include<iostream>
#include<string>
#include<regex.h>
using namespace std;
class myerror
{
     public:
         myerror(void){};
 virtual void print(void)=0;
 virtual char* what(void)=0;
 virtual ~myerror(void){};

};
class error_name:public myerror
{
      private:
         char *ptr;
      public:
         error_name(char* p);
         void print(void);
         char* what(void){return ptr;}
       ~error_name(void);
};
/////////////////////////////////////////////
class error_reg:public myerror
{
      private:
         int reg_z;
         regex_t msg_error;
         char errbuf[1024];
      public:
           error_reg(regex_t p,int z);
      void print(void);
      char* what(void){return errbuf;}
         ~ error_reg(void);
};

/*
struct error_name
{
   char *ptr;
   error_name(char* p);
   print(void);
}
error_name::error_name(char *p)
{
       ptr=p;
}
error_name::print(void)
{
      cout<<ptr<<endl;
}

*/
